<?php


namespace api\validate;


use think\Validate;

class Uservalidate extends Validate
{
    protected $rule = [
        'image' => 'require',
        'user_name' => 'require',
        'mobile' => 'require|mobile|unique:user',
        'account_type' => 'require|integer',
    ];

    protected $message = [
        'image.require' => '图片不能为空',
        'user_name' => '用户不存在',
        'mobile.unique' => '该手机号已被注册',
        'mobile.require' => '请输入电话号码',
        'mobile.mobile' => '号码格式错误',

    ];

    protected $scene = [
        'register' => ['mobile','password','account_type'],
        'login' => ['mobile'],
        'add' => ['image'],
        'edit' => ['user_name','mobile','account_type']
    ];
}